﻿using System.Web;
using DeluxeSources.Practices.ObjectContracts;
using DeluxeSources.Practices.ObjectContracts.Internal;

namespace DeluxeSources.Practices.Handlers
{
    /// <summary>
    /// PreviewHandler 的摘要说明
    /// </summary>
    public class PreviewHandler : IHttpHandler, System.Web.SessionState.IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            context.Response.Clear();
            context.Response.Write(new TransformReportGenerator() { DataSource = (ExcelDataItemCollection)context.Session["DataSource"] }.TransformText());
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}